/***    
request.globalRequest(url,请求方式,obj数据,123,true单,true 多array)url, method, data, power, isUpload, isFiles
1===没登录前的请求头
2===携带请求头token
3===刷新token
***/
import request from '@/util/request/request.ts'
const apiLogin = {}
// 微信登录 “获取登录凭证校验”“凭证校验类型:1-客户移动端，2-网点移动端")
apiLogin.mobileLogin = (data,type) => request.globalRequest({url:`/wx/applet/mobileLogin/${type}`,data, method:'post', power:1})
// “获取登录凭证校验”“凭证校验类型:1-客户移动端，2-网点移动端")
apiLogin.getCode2Session = (code,type) => request.globalRequest({url:`/wx/applet/getCode2Session/${type}/${code}`, method:'get', power:1})
//  校验手机号是否注册
apiLogin.checkPhone = (data) => request.globalRequest({url:`/mobile/user/checkPhone`, method:'GET', data,power:1})
// 登录
apiLogin.login = (data) => request.globalRequest({url:`/mobile/user/login`, method:'POST', data, power:1})
// 修改登录页面的密码
apiLogin.updatePwd = (data) => request.globalRequest({url:`/mobile/user/logInRestPwd`, method:'PUT', data,power:1})
// 查询客户移动端是否必须登录
apiLogin.getMobileUserHasLogin = (data) => request.globalRequest({url:`/mobile/user/getMobileUserHasLogin`, method:'GET', data, power:1})
// 退出登录
apiLogin.logout=()=>request.globalRequest({url:`/mobile/user/logout`,method:'GET',power:2})

export default apiLogin